from django.db import models
from django.contrib.contenttypes.models import ContentType

from django_metatagging.config import ACTION_CHOICES
from tagging.models import Tag

class ReservedTagSet(models.Model):
    name = models.CharField(max_length = 75, unique = True)
    
class ReservedTag(models.Model):
    name = models.CharField(max_length = 75, unique = True)
    description = models.TextField()
    set = models.ForeignKey(ReservedTagSet)
    
class ReservedTagInducedAction(models.Model):
    name = models.CharField(max_length = 75, unique = True)
    threshold = models.IntegerField(default = 1)
    action = models.CharField(max_length = 75, choices = ACTION_CHOICES)
    tag = models.ForeignKey(ReservedTag)
    content_type = models.ForeignKey(ContentType)

class AgnosticTags(models.Model):
    primary = models.ForeignKey(Tag, related_name = 'primary')
    secondary = models.ForeignKey(Tag, related_name = 'secondary')